#pragma once

BEGIN_NAMESPACE_OXGE


class Image;
class oglTexture : public oxgeClass<oglTexture>
{
public:

	oglTexture();
	~oglTexture();

	oglTexture& SetType(GLenum type);

	bool Init( const Image& image  );

	void Apply();


protected:


private:
	GLuint m_texid;
	GLenum m_type; //texture 1d 2d, 3d
};


class oglTextureResource : public oxgeClass<oglTextureResource>
{
public:
	int getCount()const{ return (int)m_vTextures.size(); }

	oglTexture* GetTexture(int idx){ 
		if(idx < getCount() )
			return m_vTextures[idx].get();
		return NULL;
	}

	std::vector<oglTexture::RefPtr> m_vTextures;
};


//multi texture
class oglTextureUnit : public oxgeClass<oglTextureUnit>
{
public:
	oglTextureUnit(GLenum unitName){ m_unitName = unitName; }

	GLenum m_unitName;
	void SetTexture(oglTexture* pTexture);
	
};


END_NAMESPACE_OXGE